<template>
    <div class="policy">
      <!--顶部横条-->
      <Banner></Banner>
      <!--顶部横条-->

      <mainContent :catname="title">

        <div slot="menu_list">
          <dl>
            <dt class="menu_dt" :style="{backgroundImage: 'url(' + menu_bg + ')'}"><span class="iconfont icon-lvyouchengshijianzhucity-nongcunfangzihouse"></span>{{title}}</dt>
          </dl>
        </div>



        <div slot="inner_content" class="inner_content">
          <!--公告公示-->
            <!--*********************-->
          <div class="contain_box">

            <NoData v-if="flag"></NoData>
            <!--<NoData v-if="notices.length==0"></NoData>-->

              <!--公告公开-->
              <div :key="index" v-for="(item,index) in notices" @click="toListDetail(item.id)" class="notice">
                <p class="detail_title">{{item.title}}</p>
                <div  style="overflow: hidden;text-overflow: ellipsis;overflow: hidden;white-space: nowrap;width: 85%;" class="desc" v-html="item.desc"></div>
                <div class="date" style="text-align: left;bottom: 36px;">{{item.create_at}}</div>
                <!--<p class="date">2020-04-01&nbsp;11:52</p>-->
              </div>
              <!--公告公开-->
          </div>
            <!--*********************-->
          <!--公告公示-->
        </div>
      </mainContent>

      <footerBar></footerBar>
      <!--左侧漂浮菜单-->
      <MainMenu></MainMenu>
      <!--左侧漂浮菜单-->
    </div>
</template>

<script>
  import Banner from '../../components/bannder/Banner'
  import MainMenu from  '../../components/mainmenu/MainMenu'
  import footerBar from '../../components/content/footerBar'
  import mainContent from '../../components/content/mainContent'
  import NoData from '@/components/nodata/NoData'
    export default {
        name: "policy",
        data(){
          return{
            flag:false,
            notices:[],//政策法规
            menu_bg:'',
            title:'',
            type:0,
          }
        },
        components:{
          Banner,
          MainMenu,
          footerBar,
          mainContent,
          NoData,

        },
      created(){
        this.menu_bg=this.$util.storage.get("menu_bg");
        this.title = this.$route.query.name;
        this.type = this.$route.query.type;

        this.getNotices();
      },
      methods:{
        toListDetail(id){
          console.log('您点击了跳转路由事件！,公告公示id：',id);
          this.$router.push({path:'/detail',query:{id:id,name:this.title}});
        },

        getNotices(){
          // this.$router.go(0);
          console.log('this.$route.query.name:',this.$route.query.name);
          this.$http.get("api/ScreenkApi/getColumnContent?type="+this.type+"&page=1&limit=1000",{vollege_id:this.$util.vollege_id},r=>{
            console.log('公告公示',r.data.data);
            this.notices=r.data.data;
            if (r.data.data.length==0){
              this.flag=true
            }


          });
        },//获取公告公示





      },


    }
</script>

<style scoped>
  .policy{
    width: 100vw;
    height: 1080px;
    background: url("../../assets/images/banner/bg_banner1.jpg") center top no-repeat;
  }
  .inner_content{
    box-sizing: border-box;
    padding-top: 60px;
    padding-left: 30px;
    padding-right: 30px;
    height: 700px;
  }
  .contain_box{
    height: 640px;
    overflow-y: scroll;
  }






</style>
